<?php
$query = "select * from tbl_companies";
$result = mysql_query($query);
?>
<style type="text/css">
.hide{
	display:none;
}
.show{
	display:block;
}
</style>
<script type="text/javascript">
  function editcmpy(id){
  	$(".companyInfo").removeClass( 'show').addClass('hide');
  	$.post("/aec1/pages/edit_companyInfo.php",{cid:id},function(data){
  		if(data!=''){
  			$('.editCmpyInfo').append(data);
  			}
  	});
  }
</script>  
<fieldset style="font-size: 11px;">
<legend><strong>Company Profile Information</strong></legend>
<div class="companyInfo show">
<h4>Lists Of All Company Profile Information</h4>
<table cellspacing='2' cellpadding='5' >
	<tr style="background-color:#0673C5;color:#FFFFFF;">
		<th>Company Name</th>
		<th>Address</th>
		<th>City</th>
		<th>Extension</th>
		<th>Phone</th>
		<? if($_SESSION['user_level']==2){?>
		<th>Edit</th>
		<?}?>
	</tr>
	<? while($cmpy = mysql_fetch_array($result)){?>
	<tr style="background-color:#E6E9F2;color:#222222;">
		<td><? echo $cmpy['c_name']?></td>
		<td><? echo $cmpy['c_billing_address1']?></td>
		<td><? echo $cmpy['c_billing_city']?></td>
		<td><? echo $cmpy['c_phone_extension']?></td>
		<td><? echo $cmpy['c_phone_number']?></td>
		<? if($_SESSION['user_level']==2){?>
		<td><span class="ui-icon ui-icon-pencil" title="Edit" onclick="editcmpy(<?=$cmpy['c_id'];?>)" style="float:left;cursor:pointer"></span></td>
		<?}?>
	</tr>
	<?}?>
</table>
</div>
<div class="editCmpyInfo"></div>
</fieldset>